package com.fqgj.sentry.policy.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.sentry.policy.dao.PcFunctionContextDao;
import com.fqgj.sentry.policy.entity.PcFunctionContextEntity;
import org.springframework.stereotype.Repository;

/**
 * User: kennykong
 * Date: 2017-12-05
 * Time: 16:05:36.748
 */

@Repository
public class PcFunctionContextDaoImpl extends AbstractBaseMapper<PcFunctionContextEntity> implements PcFunctionContextDao {

    @Override
    public PcFunctionContextEntity findByFunctionId(Long functionId) {
        return getSqlSession().selectOne(getStatement("findByFunctionId"), functionId);

    }

    @Override
    public Boolean deleteByFunctionId(Long functionId) {
        return getSqlSession().delete(getStatement("deleteByFunctionId"), functionId) > 0;
    }
}